//*************************************************************************************
// File:     ComparableComparer.cs
//*************************************************************************************
// Description: Encapsula un comparador comparable.
//*************************************************************************************
// Classes:      ComparableComparer : IComparer
//*************************************************************************************
// Author:      http://www.codeproject.com/csharp/csquicksort.asp
//*************************************************************************************

using System;
using System.Collections;

namespace Xeralabs.Common.Utils.Sorting
{
    /// <summary>
    /// Clase que representa un comparador comparable.
    /// </summary>
	public class ComparableComparer : IComparer
	{
		public int Compare(IComparable x, Object y)
		{
			return x.CompareTo(y);
		}

		#region IComparer Members
		int IComparer.Compare(Object x, Object y)
		{
			return this.Compare((IComparable)x,y);
		}
		#endregion
	}
}
